import { ActionTypes } from '../constants'
const initialState = {
    petList: [{
        id: 1,//宠物ID
        name: "cat01",//宠物名称
        user_id: 1,//宠物所属用户ID
        category: "",//宠物类别
        gender: 1,//宠物性别
        age: 2,//宠物年纪
        image: "test123",//宠物头像url
        profile: "小猫咪",//宠物标签
        borth_time: "2018-04-27",//宠物生日
        background: "test_background"//宠物背景图url

    },
    {
        id:  2,
        name:  "t123",
        user_id:  1,
        category:  "1",
        gender:  1,
        age:  2,
        image:  "test123",
        profile:  "猫123",
        borth_time:  "2018-05-02",
        background:  ""
    }]

}

export default function pet(state = initialState, { type, payload }) {
    switch (type) {
        case ActionTypes.API_GET_PETS_BY_USER_ID_SUCCESS:
            return {
                ...state,
                petList: payload
            }
        default:
        return {
            ...state,
        }
    }
    return state
}